package com.example.source_share.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//这里使用lombok生成set和get和其他机械函数
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {
    //对于自增主键的说明，不然会错误
    @TableId(type = IdType.AUTO)
    private Integer userid;
    private String username;
    private String password;
    private String majorid;
    private String grade;
    private String email;
    private String phonenumber;
    private int Contributions;
    private int Download;
    private String purview;
    public User(String username, String password) {
        this.userid=0;
        this.username=username;
        this.password=password;
        this.majorid="";
        this.grade="";
        this.email="";
        this.phonenumber="";
        this.Contributions=0;
        this.Download=0;
        this.purview="user";
    }
    public User(String username, String password, String majorid, String grade) {
        this.userid=0;
        this.username=username;
        this.password=password;
        this.majorid=majorid;
        this.grade=grade;
        this.email="";
        this.phonenumber="";
        this.Contributions=0;
        this.Download=0;
        this.purview="user";
    }

}
